package com.elysia.adminservice.controller;

import com.elysia.adminservice.domain.dto.UpdateLogDTO;
import com.elysia.adminservice.domain.vo.UpdateLogTotalVO;
import com.elysia.adminservice.feign.NewsFeignClient;
import com.elysia.adminservice.result.Result;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/update-log")
@RequiredArgsConstructor
@Slf4j
public class UpdateLogController {
    private final NewsFeignClient newsFeignClient;
    @GetMapping(value = "/all")
    public Result<UpdateLogTotalVO> getAllUpdateLog() {
        log.info("获取全部更新日志");
        return newsFeignClient.getAllUpdateLogs();
    }
    @PostMapping
    public Result<UpdateLogTotalVO> addUpdateLog(@RequestBody UpdateLogDTO updateLogDTO) {
        log.info("添加更新日志{}", updateLogDTO);
        return newsFeignClient.addUpdateLog(updateLogDTO);
    }
}
